package com.coder.controller;

import com.coder.entity.MajorLib;
import com.coder.service.MajorLibService;
import com.coder.utils.result.Res;
import com.coder.utils.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 王令
 */
@Slf4j
@RestController
@RequestMapping("/major")
public class MajorLibController {

    @Autowired
    private MajorLibService majorLibService;

    @GetMapping("/options")
    public Result options(){
        return Res.ok(majorLibService.options());
    }

    @GetMapping("/pages")
    public Result pages(MajorLib majorLib){
        log.info("{}", majorLib);
        return Res.ok(majorLibService.pages(majorLib));
    }
}
